<html>
<head><meta charset="utf-8"><title>x.py error format · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html">x.py error format</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192323022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323022">(Mar 30 2020 at 22:01)</a>:</h4>
<p>So i'm trying to use rust-analyzer with the compiler</p>



<a name="192323086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323086">(Mar 30 2020 at 22:02)</a>:</h4>
<p>In order to properly integrate, I need a way to run <code>x.py check</code> with options like:</p>
<p>--workspace --message-format=json --manifest-path /home/nmatsakis/versioned/rust-3/Cargo.toml --all-targets</p>



<a name="192323093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323093">(Mar 30 2020 at 22:02)</a>:</h4>
<p>in particular the json format</p>



<a name="192323102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323102">(Mar 30 2020 at 22:02)</a>:</h4>
<p>but I can't seem to find equivalent options to x.py check</p>



<a name="192323123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323123">(Mar 30 2020 at 22:02)</a>:</h4>
<p>is there some way to thread those options through that I'm missing?</p>



<a name="192323264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192323264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192323264">(Mar 30 2020 at 22:04)</a>:</h4>
<p><code>x.py --error-format json</code> gives me some strange errors:</p>
<div class="codehilite"><pre><span></span>&gt; ./x.py check --error-format json
Updating only changed submodules
Submodules updated in <span class="m">0</span>.03 seconds
    Finished dev <span class="o">[</span>unoptimized<span class="o">]</span> target<span class="o">(</span>s<span class="o">)</span> in <span class="m">0</span>.17s
Checking rustdoc artifacts <span class="o">(</span>x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu<span class="o">)</span>
Checking std artifacts <span class="o">(</span>x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu<span class="o">)</span>
error: invalid message format specifier: <span class="sb">`</span>json-diagnostic-json<span class="sb">`</span>
<span class="nb">command</span> did not execute successfully: <span class="s2">&quot;/home/nmatsakis/versioned/rust-3/build/x86_64-unknown-linux-gnu/stage0/bin/cargo&quot;</span> <span class="s2">&quot;check&quot;</span> <span class="s2">&quot;--target&quot;</span> <span class="s2">&quot;x86_64-unknown-linux-gnu&quot;</span> <span class="s2">&quot;-Zbinary-dep-depinfo&quot;</span> <span class="s2">&quot;-j&quot;</span> <span class="s2">&quot;16&quot;</span> <span class="s2">&quot;--release&quot;</span> <span class="s2">&quot;--features&quot;</span> <span class="s2">&quot;panic-unwind backtrace compiler-builtins-c&quot;</span> <span class="s2">&quot;--manifest-path&quot;</span> <span class="s2">&quot;/home/nmatsakis/versioned/rust-3/src/libtest/Cargo.toml&quot;</span> <span class="s2">&quot;--message-format&quot;</span> <span class="s2">&quot;json-render-diagnostics,json-diagnostic-json&quot;</span>
expected success, got: <span class="nb">exit</span> code: <span class="m">101</span>
failed to run: /home/nmatsakis/versioned/rust-3/build/bootstrap/debug/bootstrap check --error-format json
Build completed unsuccessfully in <span class="m">0</span>:00:01
</pre></div>



<a name="192324751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324751">(Mar 30 2020 at 22:18)</a>:</h4>
<p>we do not currently support passing cargo flags like that</p>



<a name="192324801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324801">(Mar 30 2020 at 22:19)</a>:</h4>
<p>try <code>RUSTFLAGS=</code> perhaps? Not sure if that'll work though</p>



<a name="192324861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324861">(Mar 30 2020 at 22:19)</a>:</h4>
<p>hmmm interesting</p>



<a name="192324922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324922">(Mar 30 2020 at 22:20)</a>:</h4>
<p>didn't seem to work</p>



<a name="192324931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324931">(Mar 30 2020 at 22:20)</a>:</h4>
<p>well it's probably that the rustc flag is something different</p>



<a name="192324940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324940">(Mar 30 2020 at 22:20)</a>:</h4>
<p>to be clear, I don't really need to be able to pass <em>general</em> flags</p>



<a name="192324945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324945">(Mar 30 2020 at 22:20)</a>:</h4>
<p>(I mean that'd be great but..)</p>



<a name="192324951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324951">(Mar 30 2020 at 22:20)</a>:</h4>
<p>mostly I just want the json output I think</p>



<a name="192324957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192324957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192324957">(Mar 30 2020 at 22:21)</a>:</h4>
<p>maybe i'll add it</p>



<a name="192327206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192327206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192327206">(Mar 30 2020 at 22:48)</a>:</h4>
<p>I'd be happy to support JSON output , yeah</p>



<a name="192327213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192327213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192327213">(Mar 30 2020 at 22:49)</a>:</h4>
<p>I think we already get it in fact</p>



<a name="192327214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192327214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192327214">(Mar 30 2020 at 22:49)</a>:</h4>
<p>so it should be pretty straightforward hopefully</p>



<a name="192336052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192336052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192336052">(Mar 31 2020 at 01:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/131828-t-compiler/topic/x.2Epy.20error.20format/near/192324751" title="#narrow/stream/131828-t-compiler/topic/x.2Epy.20error.20format/near/192324751">said</a>:</p>
<blockquote>
<p>we do not currently support passing cargo flags like that</p>
</blockquote>
<p>so, reading the source, there <em>is</em> <code>CARGOFLAGS</code>, but since we append <code>--message-format=json-render-diagnostics</code>, adding <code>--message-format=json</code> seems to have no effect</p>



<a name="192336778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192336778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192336778">(Mar 31 2020 at 01:20)</a>:</h4>
<p>ok, I added some <em>really hack</em> code to support <code>./x.py --json-output</code> and that... seems to work</p>



<a name="192336782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192336782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192336782">(Mar 31 2020 at 01:20)</a>:</h4>
<p>which is.. pretty nifty</p>



<a name="192378602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192378602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192378602">(Mar 31 2020 at 11:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'd love a PR, especially if you have the config options to get rust-analyzer auto checking working in the rustc tree :)</p>



<a name="192378633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192378633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192378633">(Mar 31 2020 at 11:59)</a>:</h4>
<p>(I can take a look at cleaning things up myself with the initial branch, too)</p>



<a name="192417989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192417989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192417989">(Mar 31 2020 at 16:56)</a>:</h4>
<p>right now it still takes a bit of manual fiddling, but we could fix that</p>



<a name="192417994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192417994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192417994">(Mar 31 2020 at 16:56)</a>:</h4>
<p>what I had to do was</p>



<a name="192418005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418005">(Mar 31 2020 at 16:57)</a>:</h4>
<p>create a <code>cargo-rustc-build</code> executable that does</p>



<a name="192418023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418023">(Mar 31 2020 at 16:57)</a>:</h4>
<div class="codehilite"><pre><span></span>./x.py check --json-output
</pre></div>



<a name="192418033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418033">(Mar 31 2020 at 16:57)</a>:</h4>
<p>( json-output being the flag I added )</p>



<a name="192418086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418086">(Mar 31 2020 at 16:57)</a>:</h4>
<p>and then configure the cargo command for rustc directories to run <code>rustc-build</code> as the command</p>



<a name="192418106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418106">(Mar 31 2020 at 16:57)</a>:</h4>
<p>I could open a PR to add the flag and then open a rustc-dev-guide PR explaining the setup</p>



<a name="192418179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418179">(Mar 31 2020 at 16:58)</a>:</h4>
<p>there's probably better ways to do it</p>



<a name="192418235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192418235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192418235">(Mar 31 2020 at 16:58)</a>:</h4>
<p>in particular, it might be nice if we were able to "pipe through" the options that rust-analyzer is giving us, instead of me just hardcoding things when invoking <code>x.py</code></p>



<a name="192419871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192419871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192419871">(Mar 31 2020 at 17:10)</a>:</h4>
<p>yeah, I think I'd just want the flag for now, we can think about expanding it further</p>



<a name="192419939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192419939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192419939">(Mar 31 2020 at 17:11)</a>:</h4>
<p>I've been doing some thinking recently about how x.py should behave better for this sort of use case</p>



<a name="192657707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192657707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192657707">(Apr 02 2020 at 12:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> rust-analyzer's side of implementaiton is here: <a href="https://github.com/rust-analyzer/rust-analyzer/pull/3825" title="https://github.com/rust-analyzer/rust-analyzer/pull/3825">https://github.com/rust-analyzer/rust-analyzer/pull/3825</a></p>
<p>Now it is possible to set arbitrary command for on-the-fly error checking.</p>



<a name="192658317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192658317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192658317">(Apr 02 2020 at 12:37)</a>:</h4>
<p>The relevant config should look like this: </p>
<div class="codehilite"><pre><span></span>14:36:43|~/projects/rust|master✓
λ bat -p ./.vscode/settings.json
{
    &quot;rust-analyzer.checkOnSave.overrideCommand&quot;: [
        &quot;./x.py&quot;,
        &quot;check&quot;,
        &quot;--json-output&quot;
    ]
}
</pre></div>



<a name="192658890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192658890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192658890">(Apr 02 2020 at 12:41)</a>:</h4>
<p>Great! We should definitely get json-output upstreamed in that case.</p>



<a name="192668565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668565">(Apr 02 2020 at 13:58)</a>:</h4>
<p>I wonder if <code>--error-output=json</code> would be a better thing to expose this as or if it really doesn't matter</p>



<a name="192668705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668705">(Apr 02 2020 at 13:59)</a>:</h4>
<p>uh, well, I mean, we could expose the error-format option, though I don't know to what extent (i.e. I wouldn't want to necessarily spend time supporting all the permutations, just JSON for rust-analyzer, I think)</p>



<a name="192668938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668938">(Apr 02 2020 at 14:00)</a>:</h4>
<p>hmm are there still permutations? I was under the impression that all the JSON flags are under <code>--json</code> now</p>



<a name="192668960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668960">(Apr 02 2020 at 14:00)</a>:</h4>
<p>ah, perhaps</p>



<a name="192668974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668974">(Apr 02 2020 at 14:00)</a>:</h4>
<p>I meant that rustbuild itself also needs JSON</p>



<a name="192668988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192668988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192668988">(Apr 02 2020 at 14:00)</a>:</h4>
<p>(just from Cargo though)</p>



<a name="192669046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192669046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192669046">(Apr 02 2020 at 14:01)</a>:</h4>
<p>but if it's e.g. a match statement that just always enables cargo's json as needed, then I'm happy</p>



<a name="192669177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192669177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192669177">(Apr 02 2020 at 14:02)</a>:</h4>
<p>I'll open a PR against rustbuild, I don't care what the option is</p>



<a name="192669307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192669307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192669307">(Apr 02 2020 at 14:03)</a>:</h4>
<p>yeah just some groundwork (whatever you have locally) would be helpful, I can polish it up if needed -- though I don't care too much how things look if they work :)</p>



<a name="192671021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192671021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192671021">(Apr 02 2020 at 14:16)</a>:</h4>
<p><code>--error-format=</code> would be nice because I think it could allow using the shorter errors but idk if those have been made to work</p>



<a name="192671058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192671058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192671058">(Apr 02 2020 at 14:16)</a>:</h4>
<p>I think they hide the labels instead of rendering them differently, which is a shame</p>



<a name="192674516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/x.py%20error%20format/near/192674516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/x.2Epy.20error.20format.html#192674516">(Apr 02 2020 at 14:39)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> opened <a href="https://github.com/rust-lang/rust/pull/70698/" title="https://github.com/rust-lang/rust/pull/70698/">https://github.com/rust-lang/rust/pull/70698/</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>